package com.service;

import com.dao.MenuMapper;
import com.dao.UserMapper;
import com.pojo.Menu;
import com.pojo.User;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class MenuService {

	@Resource
	private MenuMapper menuMapper;

	public List<Menu> findAll() {
		return menuMapper.findAll();
	}

	public Menu findById(Integer id) {
		return menuMapper.findById(id);
	}

	public void insert(Menu menu) {
		menuMapper.insert(menu);
	}

	public void update(Menu menu) {
		menuMapper.update(menu);
	}

	public void deleteById(Integer id) {
		menuMapper.deleteById(id);
	}

	public List<Menu> findMenusByRoleFlag(String roleFlag) {
		return menuMapper.findMenusByRoleFlag(roleFlag);
	}
}
